<%= form_for [:shop, @fare_template], html: { class: "card" } do |f| %>
  <div class="card-body">
    <h3 class="card-title">
      <%= @fare_template.new_record? ? "新增运费模版" : "修改运费模版" %>
    </h3>
    <div class="row">
      <div class="col-md-4">
        <div class="form-group">
          <label class="form-label">运费模版名字</label>
          <%= f.text_field :name, class: "form-control" %>
        </div>
      </div>
      <div class="col-md-4">
        <div class="form-group">
          <div class="form-label">计费方式</div>
          <div class="custom-controls-stacked">
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :compute_method, "location", { class: "custom-control-input" } %>
              <span class="custom-control-label">地区</span>
            </label>
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :compute_method, "distance", { class: "custom-control-input" } %>
              <span class="custom-control-label">距离</span>
            </label>
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :compute_method, "weight", { class: "custom-control-input" } %>
              <span class="custom-control-label">重量</span>
            </label>
          </div>
        </div>
      </div>
      <div class="col-md-4">
        <div class="form-group">
          <div class="form-label">配送方式</div>
          <div class="custom-controls-stacked">
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :fare_method, "express", { class: "custom-control-input" } %>
              <span class="custom-control-label">快递</span>
            </label>
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :fare_method, "normal", { class: "custom-control-input" } %>
              <span class="custom-control-label">平邮</span>
            </label>
            <label class="custom-control custom-radio custom-control-inline">
              <%= f.radio_button :fare_method, "ems", { class: "custom-control-input" } %>
              <span class="custom-control-label">物流</span>
            </label>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="card-footer text-right">
    <%= f.submit "保 存", class: "btn btn-primary" %>
  </div>
<% end %>